using System.Collections.Generic;

namespace KruskalAlgorithm
{
    class StackItemKruskal
    {
        #region Member Variables
        public int indexCurrentEdKruskal;
        public Edge currentEd;
        public Vertex currentVRoot1, currentVRoot2;
        public List<Edge> LEdgesRetun;
        public int stepNumber;
        #endregion

        #region Properties
        public Edge getCurrentEd
        {
            get
            {
                return currentEd;
            }
        }
        public Vertex getCurrentVRoot1
        {
            get
            {
                return currentVRoot1;
            }
        }
        public Vertex getCurrentVRoot2
        {
            get
            {
                return currentVRoot2;
            }
        }
        public List<Edge> getLEdgesRetun
        {
            get
            {
                return LEdgesRetun;
            }
        }
        public int getStepNumber
        {
            get
            {
                return stepNumber;
            }
        }
        #endregion

        public StackItemKruskal(int indexCurrentEdKruskal, Edge _currentEd, Vertex _currentVRoot1, Vertex _currentVRoot2, List<Edge> _LEdgesRetun, int stepNumber)
        {
            this.indexCurrentEdKruskal = indexCurrentEdKruskal;
            if (_currentEd == null)
            {
                this.currentEd = null;
            }
            else
            {
                this.currentEd = (Edge)_currentEd.Clone();
            }

            if (_currentVRoot1 == null)
            {
                this.currentVRoot1 = null;
            }
            else
            {
                this.currentVRoot1 = (Vertex)_currentVRoot1.Clone();
            }

            if (_currentVRoot2 == null)
            {
                this.currentVRoot2 = null;
            }
            else
            {
                this.currentVRoot2 = (Vertex)_currentVRoot2.Clone();
            }

            this.LEdgesRetun = new List<Edge>();
            if (_LEdgesRetun.Count != 0)
            {
                foreach (Edge ed in _LEdgesRetun)
                {
                    this.LEdgesRetun.Add((Edge)ed.Clone());
                }
            }
            this.stepNumber = stepNumber;
        }
    }
}
